package appapi.Vo;

import appapi.entity.basic.EquipTypeItemEntity;
import appapi.entity.basic.SelfcheckItemEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.springframework.beans.BeanUtils;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 请求对象
 *
 * @author luocheng
 * @version 1.0
 * @date 2023/05/30 13:50
 */
@ApiModel
@Data
@NoArgsConstructor
public class AddEquipTypeItemVo implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "设备类别", required = true)
    @NotNull(message = "设备类别不能为空")
    private Long equipTypeId;

    @ApiModelProperty(value = "自检项目名称", required = true)
    @NotNull(message = "自检项目名称不能为空")
    @Length(max = 20, message = "模块标识不能超过20个字符,请确认.")
    private String itemName;


    @ApiModelProperty(value = "备注说明")
    private String itemDesc;

    public EquipTypeItemEntity vo2Entity(){
        EquipTypeItemEntity entity = new EquipTypeItemEntity();
        BeanUtils.copyProperties(this,entity);
        return entity;
    }
}